package wili.attrMapping._user.b1.exp;

import java.util.function.Predicate;
import wili.c.Ca;
import wili.c.reg.MatchRet;

/**
 * 
 * @author weila 2022年10月5日
 */
public class LrExp extends MathExpB1 {
	MathExpB1 exp;

	public String toString() {
		return "(" + exp + ")";
	}

	public LrExp(MatchRet mat) {
		this.exp = MathExpB1.expOf(mat.son(1));
	}

	public void traverse(Predicate<MathExpB1> pred) {
		exp.traverse(pred);
	}

	@Override
	public Boolean isTrue() {
		return (Boolean) value();
	}

	@Override
	public <T> T value() {
		Ca.asert(false, "");
		return null;
	}

	@Override
	public String getString(int refresh) {
		if (refresh == 1 || expSt == null) {
			return this.expSt = "(" + exp.getString(refresh) + ")";
		}
		return this.expSt;
	}
}
